package uk.ac.glasgow.oose2.gcf.model;

import uk.ac.glasgow.oose2.gcf.model.operation.stack.impl.Swap;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.E;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.NaturalLog;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Exponential;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Pi;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Power;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Radian;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.RadianSine;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.RadianCosine;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.RadianTangent;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Sqrt;
import uk.ac.glasgow.oose2.gcf.model.operation.stack.math.impl.Time;

/**
 * 
 * Scientific extension to the basic calculator
 * 
 * @author J Sventek
 * @author tws
 * @author W Grayson
 * @version 1.0
 */
public class ScientificCalculator extends BasicCalculator {
	
	/**
	 * Constructs new Scientific Calculator
	 */
	public ScientificCalculator() {
		super();
	}
		
	/** push the constant e onto the top element of the stack */
	public void e() throws CalculatorException {new E(stack).invoke();}
	
	/** replace the top element of the stack by its natural logarithmic root */
	public void ln() throws CalculatorException {new NaturalLog(stack).invoke();}
	
	/** replace the top element of the stack by its exponent */
	public void exp() throws CalculatorException {new Exponential(stack).invoke();}
	
	/** replace the top two elements of the stack by the first to the power of the second */
	public void pow() throws CalculatorException {new Power(stack).invoke();}
	
	/** replace the top element of the stack by its value in Radians */
	public void rad() throws CalculatorException {new Radian(stack).invoke();}
	
	/** replace the top element of the stack by its value under the Sine function */
	public void sin() throws CalculatorException {new RadianSine(stack).invoke();}

	/** replace the top element of the stack by its value under the Cosine function */
	public void cos() throws CalculatorException {new RadianCosine(stack).invoke();}
	
	/** replace the top element of the stack by its value under the Tangent function */
	public void tan() throws CalculatorException {new RadianTangent(stack).invoke();}
	
}